package cc.bookcloud.tool.ocr.common.enum1;

/*==========================================================================
 * Copyright (C) Wit2Cloud Co.,Ltd
 * All Rights Reserved.
 * Created By 开源学社
 ==========================================================================*/
public enum SystemInfoEnum {
    PLATFORM("平台模块","platform","app","P"),
    BASIC("基础信息库","basic","app","B"),
    CAFWE("工作流","cafwe","app","C"),
    SEARCH("文件模块","search","app","S"),
    BI("report报表","bi","app","R");
    // 名称
    private String name;
    // 标识
    private String identify;
    // 类型: app-应用;script-脚本;sql-数据库sql;conf-配置,platform[pbcsr].jar
    private String type;
    // 简称
    private String shortName;

    SystemInfoEnum(String name, String identify,String type,String shortName) {
        this.name = name;
        this.identify = identify;
        this.type = type;
        this.shortName = shortName;
    }

    // 普通静态方法方法  可通过枚举类直接调用

    /**
     *  通过系统标识获得名称信息
     * @param identify
     * @return
     */
    public static String getName(String identify) {
        for (SystemInfoEnum c : SystemInfoEnum.values()) {
           if(c.identify.equalsIgnoreCase(identify)){
               return c.name;
           }
        }
        return null;
    }


    // 普通静态方法方法  可通过枚举类直接调用

    /**
     * 通过名称获得系统标识
     * @param name
     * @return
     */
    public static String getIdentify(String name) {
        for (SystemInfoEnum c : SystemInfoEnum.values()) {
            if(c.name.equalsIgnoreCase(name)){
                return c.identify;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIdentify() {
        return identify;
    }

    public void setIdentify(String identify) {
        this.identify = identify;
    }

    public String getType() {
        return type;
    }
}
